package org.dreamwork.hyacinth.jasmine;

import org.dreamwork.jasmine2.engine.IValidatable;
import org.dreamwork.jasmine2.events.IValidateListener;
import org.dreamwork.jasmine2.events.ValidatableDelegate;
import org.dreamwork.jasmine2.web.IWebControl;
import org.dreamwork.jasmine2.web.controls.WebContainer;

/**
 * Created by IntelliJ IDEA.
 * User: seth.yang
 * Date: 12-3-20
 * Time: 下午6:24
 */
public class HTMLMailControl extends WebContainer implements IValidatable, IValidateListener {
    protected ValidatableDelegate degelate = new ValidatableDelegate ();

    public void addValidateListener (IValidateListener listener) {degelate.addValidateListener (listener);}

    public void removeValidateListener (IValidateListener listener) {degelate.removeValidateListener (listener);}

    public IValidateListener[] getValidateListners () {return degelate.getValidateListners ();}

    public boolean fireValidateListeners (IWebControl sender) {return degelate.fireValidateListeners (sender);}

    public boolean onValidate (IWebControl sender) {
        return page instanceof HTMLMail;
    }
}